//
//  LandCityTableViewCell.m
//  旅游咨询
//
//  Created by 高建 on 15/4/14.
//  Copyright (c) 2015年 xubin. All rights reserved.
//

#import "LandCityTableViewCell.h"

@implementation LandCityTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
//        UIImage *image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
//        self.headerImageView = [[UIImageView alloc] initWithImage:image];
//        [self.contentView addSubview:_bgImageView];
        
//self.bg1iamgeView.frame = CGRectMake(3, 0, self.contentView.frame.size.width + 43, self.contentView.frame.size.height * 3);
        
        UIImage *bg1image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
        self.bg1iamgeView = [[UIImageView alloc] initWithImage:bg1image];
        self.bg1iamgeView.frame = CGRectMake(3, 0, WidthZ * 0.973, HeighZ * 0.2);
        [self.contentView addSubview:_bg1iamgeView];
        [_bg1iamgeView release];
        
        self.headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, WidthZ * 0.973 / 3, HeighZ * 0.2 - 10)];
        self.headerImageView.backgroundColor = [UIColor redColor];
        [self.bg1iamgeView addSubview:_headerImageView];
        [_headerImageView release];
        
        
        
        
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(WidthZ * 0.973 / 3 + 15, 0, self.bg1iamgeView.frame.size.width * 0.66666 - 15, HeighZ * 0.2 / 4)];
//        self.nameLabel.backgroundColor = [UIColor greenColor];
        [self.bg1iamgeView addSubview:_nameLabel];
        [_nameLabel release];
        
        
        self.recommended_reasonLabel = [[UILabel alloc] initWithFrame:CGRectMake(WidthZ * 0.973 / 3 + 15, self.nameLabel.frame.size.height + self.nameLabel.frame.origin.y , self.bg1iamgeView.frame.size.width * 0.66666 - 15 , HeighZ * 0.2 / 2)];

        [self.contentView addSubview:_recommended_reasonLabel];
        [_recommended_reasonLabel release];
        
        
        self.visited_countLabel = [[UILabel alloc] initWithFrame:CGRectMake(WidthZ * 0.973 / 3 + 15, self.recommended_reasonLabel.frame.origin.y + self.recommended_reasonLabel.frame.size.height , self.bg1iamgeView.frame.size.width * 0.66666 - 15 , HeighZ * 0.2 / 4)];
        [self.bg1iamgeView addSubview:_visited_countLabel];
        [_visited_countLabel release];
        
    }
    return self;
}


-(void)setMyDetailModel:(InLandCityDetailModel *)myDetailModel
{
    if (_myDetailModel != myDetailModel) {
        [_myDetailModel release];
        _myDetailModel = [myDetailModel retain];
    }

    self.visited_countLabel.text = [NSString stringWithFormat:@"%@ 人去过", myDetailModel.visited_count];
    
    self.nameLabel.text = myDetailModel.name;
    self.recommended_reasonLabel.text = myDetailModel.recommended_reason;
    self.recommended_reasonLabel.numberOfLines = 0;
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:myDetailModel.cover_s]];
    
}
-(void)setMyHouseModel:(HouseTableView *)myHouseModel
{
    if (_myHouseModel != myHouseModel) {
        [_myHouseModel release];
        _myHouseModel = [myHouseModel retain];
    }
    
    self.visited_countLabel.text = [NSString stringWithFormat:@"%@ 人去过", myHouseModel.visited_count];
    
    self.nameLabel.text = myHouseModel.name;
    self.recommended_reasonLabel.text = myHouseModel.recommended_reason;
    self.recommended_reasonLabel.numberOfLines = 0;
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:myHouseModel.cover_s]];
}

-(void)setMyRestaurantModel:(RestaurantTableView *)myRestaurantModel
{
    if (_myRestaurantModel != myRestaurantModel) {
        [_myRestaurantModel release];
        _myRestaurantModel = [myRestaurantModel retain];
    }
    
 
    self.visited_countLabel.text = [NSString stringWithFormat:@"%@ 人去过", myRestaurantModel.visited_count];
    
    //    NSString *description = [NSString stringWithFormat:@"概述:%@", self.HotSiteDetail.descriptions];
    self.nameLabel.text = myRestaurantModel.name;
    self.recommended_reasonLabel.text = myRestaurantModel.recommended_reason;
    self.recommended_reasonLabel.numberOfLines = 0;
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:myRestaurantModel.cover_s]];
}













- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
